home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / security / xinetd / xinetd.2.0.6 / defs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-22  |  2.8 KB  |  123 lines

  1. /*
  2.  * (c) Copyright 1992 by Panagiotis Tsirigotis
  3.  * All rights reserved.  The file named COPYRIGHT specifies the terms 
  4.  * and conditions for redistribution.
  5.  */
  6.  
  7. #ifndef DEFS_H
  8. #define DEFS_H
  9.  
  10. /*
  11.  * $Id: defs.h,v 5.1 1992/10/31 23:59:07 panos Exp $
  12.  */
  13.  
  14. #include <memory.h>
  15.  
  16. #ifndef NULL
  17. #define NULL                             0
  18. #endif
  19.  
  20. #ifndef FALSE
  21. #define FALSE                             0
  22. #define TRUE                              1
  23. #endif
  24.  
  25. #define NUL                      '\0'
  26.  
  27. #define ES_NOMEM                        "out of memory"
  28.  
  29. #define INT_NULL                        ((int *)0)
  30. #define CHAR_NULL                        ((char *)0)
  31. #define VOID_NULL                        ((char *)0)
  32. #define FD_SET_NULL                    ((fd_set *)0)
  33. #define RUSAGE_NULL                    ((struct rusage *)0)
  34. #define TIMEVAL_NULL                    ((struct timeval *)0)
  35. #define ITIMERVAL_NULL                ((struct itimerval *)0)
  36. #define SOCKADDRIN_NULL                ((struct sockaddr_in *)0)
  37.  
  38. #define PRIVATE                        static
  39.  
  40. #define EQ( s1, s2 )                    ( strcmp( s1, s2 ) == 0 )
  41. #define CLEAR( x )                    (void) memset( (char *)&(x), 0, sizeof( x ) )
  42. #define SA( p )                        ( (struct sockaddr *) (p) )
  43.  
  44. /*
  45.  * Value for unlimited server instances
  46.  */
  47. #define UNLIMITED                        (-1)
  48.  
  49. /*
  50.  * Service port for the identification service
  51.  */
  52. #define IDENTITY_SERVICE_PORT        113
  53.  
  54. /*
  55.  * This is the signal sent to interceptor processes to tell them
  56.  * to stop intercepting
  57.  */
  58. #define INTERCEPT_SIG                SIGUSR1
  59.  
  60. /*
  61.  * This is how many descriptors we reserve for ourselves:
  62.  *
  63.  *        3     for stdin, stdout, stderr
  64.  *        1     for syslog/debug
  65.  *
  66.  * For the rest we just need to reserve the maximum of each category.
  67.  *
  68.  *        1     for doing accepts
  69.  *        1     for registering rpc services (initialization phase)
  70.  *        4     for reading the configuration file during reconfiguration
  71.  *                1 for the configuration file
  72.  *                1 for /etc/passwd
  73.  *                1 for /etc/group
  74.  *                1 for /etc/services, /etc/protocols, /etc/rpc
  75.  *                NOTE: We need only 1 descriptor for the last 3 files because
  76.  *                        the functions get{serv,proto,rpc}byname close the
  77.  *                        respective files after accessing them.
  78.  *        1     for dumping the internal state
  79.  *        1    for talking to the portmapper (reconfiguration phase)
  80.  *
  81.  * NOTE: we assume that the socket used for pmap_{set,unset} is closed
  82.  *            after the operation is completed. If it stays open, then we
  83.  *            need to increase DESCRIPTORS_RESERVED.
  84.  */
  85. #define DESCRIPTORS_RESERVED            8
  86.  
  87. /*
  88.  * Used for listen(2)
  89.  */
  90. #define LISTEN_BACKLOG                    7
  91.  
  92. /*
  93.  * When explicit values are given for enum's, that is because the structures 
  94.  * that the enum's are in may be initialized by a memory clear operation.
  95.  */
  96.  
  97. typedef enum { FAILED = 0, OK } status_e ;
  98. typedef enum { NO = 0, YES } boolean_e ;
  99.  
  100. typedef int bool_int ;
  101.  
  102. typedef void (*voidfunc)() ;
  103.  
  104.  
  105. struct name_value
  106. {
  107.    char *name ;
  108.    int value ;
  109. } ;
  110.  
  111. struct name_value *nv_find_value(), *nv_find_name() ;
  112.  
  113.  
  114. struct debug
  115. {
  116.     bool_int on ;
  117.     int fd ;
  118. } ;
  119.  
  120. extern struct debug debug ;
  121.  
  122. #endif    /* DEFS_H */
  123.